﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using BusinessObjects.BO_GetObjects;

public partial class Controls_ucSlider : System.Web.UI.UserControl
{
    string module_id;

    public string Module_id
    {
        get { return module_id; }
        set { module_id = value; }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            loadData();
        }
    }

    protected void loadData()
    {
        DataTable objDT = BO_Products.SelectByModule(1, 1, 12, Convert.ToInt32(module_id));
        rptMain.DataSource = objDT;
        rptMain.DataBind();
        if (objDT.Rows.Count > 3)
        {
            for (int i = 3; i < objDT.Rows.Count; i++)
            {
                objDT.Rows.RemoveAt(objDT.Rows.Count - 1);
            }
        }
        rptThumb.DataSource = objDT;
        rptThumb.DataBind();
    }
}